<%--
  Created by IntelliJ IDEA.
  User: Berlin-IOU
  Date: 2017/12/5
  Time: 21:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>修改用户</title>
    <link type="text/css" href="${pageContext.request.contextPath}/assets/lib/css/bootstrap.min.css" rel="stylesheet">
    <link type="text/css" href="${pageContext.request.contextPath}/assets/lib/css/bootstrap.css" rel="stylesheet">
    <link type="text/css" href="${pageContext.request.contextPath}/assets/lib/css/bootstrap-datepicker.min.css"
          rel="stylesheet">
</head>
<body>
<div class="container" style="margin-top: 50px">
    <form class="form-horizontal" action="${pageContext.request.contextPath}/users/${USER.id}/update" method="post"
          role="form">
        <input type="hidden" name="_method" value="PUT">
        <div class="form-group">
            <label for="name" class="col-sm-2 control-label">名字</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="name" id="name" value="${USER.name}">
            </div>
        </div>

        <div class="form-group">
            <label for="gender" class="col-sm-2 control-label">性别</label>
            <div class="col-sm-4">
                <c:forEach items="${GENDER}" var="gender" varStatus="stat">
                    <label class="radio-inline">
                        <input type="radio" id="gender" name="gender"
                               value="${gender}" ${gender==USER.gender?'checked':''}> ${gender.text}
                    </label>
                </c:forEach>
            </div>
        </div>

        <div class="form-group">
            <label for="birthday" class="col-sm-2 control-label">出生日期</label>
            <div class="col-sm-4">
                <input type="text" class="form-control birthday" name="birthday" id="birthday"
                       value='<fmt:formatDate value="${USER.birthday}" pattern="yyyy-MM-dd"/> '>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-default btn-warning">修改</button>
            </div>
        </div>
    </form>
</div>
<script type="application/javascript"
        src="${pageContext.request.contextPath}/assets/lib/js/jquery-3.2.1.min.js"></script>
<script type="application/javascript"
        src="${pageContext.request.contextPath}/assets/lib/js/bootstrap.min.js"></script>
<script type="application/javascript"
        src="${pageContext.request.contextPath}/assets/lib/js/bootstrap-datepicker.js"></script>
<script type="application/javascript"
        src="${pageContext.request.contextPath}/assets/lib/js/bootstrap-datepicker.min.js"></script>
<script type="application/javascript"
        src="${pageContext.request.contextPath}/assets/lib/js/bootstrap-datepicker.zh-CN.min.js"></script>
<script type="application/javascript" src="${pageContext.request.contextPath}/assets/app/js/user.js"></script>
</body>
</html>
